"""TXZY URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from mainsite import views

urlpatterns = [
    path('', views.home),  # 首页
    path('login/', views.login),  # 登录
    path('list/', views.index),  # 新闻首页
    path('photo/', views.photo),  # 图片专区
    path('write/', views.write),  # 文章投稿
    path('logout/', views.logout),  # 退出登录
    path('contact/', views.contact),  # 联系我们
    path('collect/', views.collect),  # 收藏列表
    path('hotnews/', views.hotnews),  # 热度新闻
    path('admin/', admin.site.urls),  # 管理页面
    path('register/', views.register),  # 用户注册
    path('userinfo/', views.userinfo),  # 用户信息
    path('updatevote/', views.updatevote),  # 点赞
    path('modifypwd/', views.modifypwd),  # 更改密码
    re_path(r'^news/(\w+)$', views.news),  # 文章分类
    re_path(r'^post/(\w+)$', views.showpost),  # 文章详情
    re_path(r'^search/(.*)$', views.search),  # 文章搜索
    re_path(r'^(\d+)/(\w+)$', views.delcom),  # 删除评论
    re_path(r'^photo/(\w+)$', views.showphoto),  # 图片显示
    path('checkusername/', views.checkusername),  # 验证用户名
    re_path(r'^add_collect/(\w+)$', views.add_collect),  # 收藏储存
    re_path(r'^collect/del/(\w+)$', views.del_collect),  # 取消收藏
    path('findfri/',views.findFri),
    path('fricom/',views.friCom),
    path('addfri/',views.addFri),
]
